package kd.bos.openapi.sdk.util;

import org.apache.commons.lang3.RandomStringUtils;

import java.util.Date;

/**
 * @author johnz
 * @Deacription 字符串工具类
 * @date 2022年4月6日
 */
public class StringUtils {
    public static boolean isEmpty(Object str) {
        return str == null || "".equals(str);
    }

    /**
     * 获取traceId
     * @param thirdApp
     * @return
     */
    public static String getTrace(String thirdApp) {
        String trace = thirdApp;
        trace += DateUtil.format(new Date(), "yyyyMMddhhmmss");
        trace += RandomStringUtils.randomAlphabetic(6);
        return trace;
    }

}
